package com.umeox.watch.moto.apiclient.http.response;

import java.util.Arrays;

public class WaasResponseImpl implements WaasResponse {
    private int code;
    private String message;
    private Object data;
    private byte[] rawData;

    @Override
    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public boolean isSuccessful() {
        return this.code == 0 || this.code == 200;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public byte[] getRawData() {
        return this.rawData;
    }

    public void setRawData(byte[] rawData) {
        this.rawData = rawData;
    }

    @Override
    public String toString() {
        return "WaasResponseImpl{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                ", rawData=" + Arrays.toString(rawData) +
                '}';
    }
}
